<template>
  <el-dialog
    :model-value="visible"
    title="详情"
    width="600"
    :close-on-click-modal="false"
    @close="cls"
  >
    <li>货代单号：{{ data.hcode }}</li>
    <li>货代名称：{{ data.hname }}</li>
    <li>运费：{{ data.hprice }}</li>
    <li>起始地：{{ data.start }}</li>
    <li>目的地：{{ data.end }}</li>
  </el-dialog>
</template>

<script setup>
const emits = defineEmits(["close", "refresh"]);
let data;
function cls() {
  emits("refresh"); // 触发刷新事件
  emits("close");
}
async function init(hcode, hname, hprice, start, end) {
  data = {
    hcode: hcode,
    hname: hname,
    hprice: hprice,
    start: start,
    end: end
  };
}
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  }
});

defineExpose({ init });
</script>
